package com.winshare.saleAssistant.dao;

import com.winshare.saleAssistant.domain.entity.AppRoleDO;
import com.winshare.saleAssistant.domain.entity.AppRoleRelationDO;
import com.winshare.saleAssistant.domain.query.AppRoleQuery;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@Mapper
public interface AppRoleMapper {

    int saveAppRole(AppRoleDO appRoleDO);

    int updateAppRole(AppRoleDO appRoleDO);

    int deleteRelationByAppRole(AppRoleDO appRoleDO);

    int batchInsertAppRoleRelation(@Param("appRoleRelationDOList")List<AppRoleRelationDO> appRoleRelationDOList);

    AppRoleDO queryAppRole(AppRoleDO appRoleDO);

    int countByAppRoleName(AppRoleDO appRoleDO);

    int queryAppRoleCount(AppRoleQuery appRoleQuery);

    List<AppRoleDO> findAppRoleListByConditions(AppRoleQuery appRoleQuery);

    AppRoleDO getAppRole(AppRoleDO appRoleDO);

    int countAppWithAppRole(AppRoleDO appRoleDO);

    int  countStaffWithAppRole(AppRoleDO appRoleDO);

    int deleteAppRole(AppRoleDO appRoleDO);
}
